package cn.fan.springboot_easyexcle.dao;

import cn.fan.springboot_easyexcle.model.UserExportVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.ResultSetType;
import org.apache.ibatis.session.ResultHandler;

/**
 * @author 奔腾的野马
 * @date 2022/04/16 19:14
 */
@Mapper
public interface UserDao {

	//ResultSetType.TYPE_FORWORD_ONLY 结果集的游标只能向下滚动,fetchSize需要设置为Integer.MIN_VALUE游标才能生效
    @Options(resultSetType = ResultSetType.FORWARD_ONLY,fetchSize = Integer.MIN_VALUE)
    @ResultType(UserExportVO.class)
    @Select("select userName,mobile from user limit 500000")
    void reportAll2(ResultHandler<UserExportVO> handler);

}

